import 'dart:convert' show json;

class VideoInfoRsp {

  int code;
  InfoData rescont;

  VideoInfoRsp.fromParams({this.code, this.rescont});

  factory VideoInfoRsp(jsonStr) => jsonStr == null ? null : jsonStr is String ? new VideoInfoRsp.fromJson(json.decode(jsonStr)) : new VideoInfoRsp.fromJson(jsonStr);

  VideoInfoRsp.fromJson(jsonRes) {
    code = jsonRes['code'];
    if(code == 200)
    rescont = jsonRes['rescont'] == null ? null : new InfoData.fromJson(jsonRes['rescont']);
  }

  @override
  String toString() {
    return '{"code": $code,"rescont": $rescont}';
  }
}

class InfoData {

  int artist;
  int id;
  String auther;
  String auther_no;
  String authername;
  String created_at;
  String introduction;
  String title;
  String videopath;

  InfoData.fromParams({this.artist, this.id, this.auther, this.auther_no, this.authername, this.created_at, this.introduction, this.title, this.videopath});

  InfoData.fromJson(jsonRes) {
    artist = jsonRes['artist'];
    id = jsonRes['id'];
    auther = jsonRes['auther'];
    auther_no = jsonRes['auther_no'];
    authername = jsonRes['authername'];
    created_at = jsonRes['created_at'];
    introduction = jsonRes['introduction'];
    title = jsonRes['title'];
    videopath = jsonRes['videopath'];
  }

  @override
  String toString() {
    return '{"artist": $artist,"id": $id,"auther": ${auther != null?'${json.encode(auther)}':'null'},"auther_no": ${auther_no != null?'${json.encode(auther_no)}':'null'},"authername": ${authername != null?'${json.encode(authername)}':'null'},"created_at": ${created_at != null?'${json.encode(created_at)}':'null'},"introduction": ${introduction != null?'${json.encode(introduction)}':'null'},"title": ${title != null?'${json.encode(title)}':'null'},"videopath": ${videopath != null?'${json.encode(videopath)}':'null'}}';
  }
}

